void real_imag(int* real, int* imag, char* num)
{
    char* token;
    token = strtok(num, "+");
    *real = atoi(token);
    token = strtok(NULL,"i");
    *imag = atoi(token); 
}



char * complexNumberMultiply(char * num1, char * num2){

    int real1, imag1;
    int real2, imag2;

    real_imag(&real1, &imag1, num1);
    real_imag(&real2, &imag2, num2);

    char* answer = (char*)malloc(sizeof(char) * 20);
    snprintf(answer, 20, "%d+%di", real1 * real2 - imag1 * imag2, real1 * imag2 + real2 * imag1);


    return answer;

}